﻿import QtQuick 2.9
import QtStudio3D 1.1
import QtQuick.Controls 2.1

Item {
    id: mainview

    focus: true

    property bool isStarted: false

    onIsStartedChanged: {
        torus_Knot01.setAttribute("scale.x", isStarted?2:1)
        torus_Knot01.setAttribute("scale.y", isStarted?2:1)
        torus_Knot01.setAttribute("scale.z", isStarted?2:1)
        torus_Knot01_Default.setAttribute("emissivepower", isStarted?100:0)
    }

    Studio3D {
        id: studio3D
        width: parent.width
        height: parent.height
        anchors.verticalCenter: parent.verticalCenter

        ViewerSettings {
            scaleMode: ViewerSettings.ScaleModeFill
        }

        Presentation {
            id: cluster
            source: "qrc:/presentation/presentation.uia"

            SceneElement {
                id: scene
                elementPath: "Scene"
            }
            Element{
                id: torus_Knot01
                elementPath: "Scene.Layer.Torus_Knot01"
            }
            Element{
                id: torus_Knot01_Default
                elementPath: "Scene.Layer.Torus_Knot01.Default"
            }

            DataInput {
                name: "newDataInput"
                value: isStarted ? "萌梦论坛 开始变身" : "萌梦论坛 停止变身"
            }
        }
    }
    MouseArea{
        anchors.fill: parent
        onClicked: isStarted = !isStarted
    }
}
